<?php
use Illuminate\Database\Eloquent\SoftDeletingTrait;

class ProductOption extends Eloquent {
	
	use SoftDeletingTrait;
	
	protected $dates = ['deleted_at'];
		
	protected $table = 'product_option';

	/**
	 * Condition: Unarchived Items.
	 * @author AngelaMisa 03/09/2015 6:44PM
	 * @param $query
	 * @return mixed
	 */
	public function scopeActive( $query ) {
		return $query->where($this->table . '.archived', 0);
	}
	
	/**
	 * Relates to Product ID.
	 * @author AngelaMisa 03/09/2015 6:44PM
	 * @return mixed
	 */
	public function product() {
		return $this->belongsTo('Product', 'PRODUCT_id');
	}
}